#!/bin/bash

SHAPEFILEDIR=shapefiles
RASTERFILEDIR=rasters

# Convert shapefiles in layers and dump in data directory
for x in `ls $SHAPEFILEDIR`
do
    echo ogr2ogr -f "GeoJSON"  -t_srs "EPSG:900913" ../data/$x.geojson $SHAPEFILEDIR/$x
    ogr2ogr -overwrite -f "GeoJSON"  -t_srs "EPSG:900913" ../data/$x.geojson $SHAPEFILEDIR/$x
done

# Convert raster files in raster dir and dump in data directory
for x in `ls $RASTERFILEDIR`
do
    echo gdal_translate -a_srs "EPSG:900913" -of "PNG" $RASTERFILEDIR/$x ../data/$x.png
    gdal_translate -a_srs "EPSG:900913" -of "PNG" $RASTERFILEDIR/$x ../data/$x.png
done
